import request from '../util/request'
    const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
    console.log(userTimeZone); // 例如，"America/New_York"
    // 获取用户的语言环境
    const userLocale = Intl.DateTimeFormat().resolvedOptions().locale;
    console.log(userLocale); // 例如，"en-US" 或 "zh-CN"
// 1. get
export const getrequest = async (apiUrl,obj) => {
    const res =  await request.get(apiUrl,{params:{timezone: userTimeZone,locale:userLocale,...obj}})
    return res
}

// 2.post
export const postrequest = (apiUrl,obj) => {
  return request.post(apiUrl,{timezone: userTimeZone,locale:userLocale,...obj})
}
// 2.事件统计
export const EventStatistics = (value1,value2) => {
  const channel_no = uni.getStorageSync('channel_no')
  return request.post('/api/event/add',{
    page_name:value1,
    version_number:'v1',
    channel_no:channel_no,
    platform:'H5',
    event_name:value2,
  })
}